﻿<!-- #include file="mymin.asp" -->
<title>会员账户管理</title></head><body><div class='main400'>
<%

dim id,rs
id=getN("id",1)
If getData("a")<>"1" Then
	set rs=Server.CreateObject("ADODB.Recordset")
	rs.open"select name,password from 74hu_user where ID="&id,myconn,1,1
	If Not rs.eof	Then
		w "<form method='post' action='password.asp'><table>"&_
			"<tr><td>用户名</td><td><input name=""name"" value="""&nowml(rs("name"))&""" maxlength=""16""/></td></tr>"&_
			"<tr><td>密码</td><td><input name=""pass"" value="""&nowml(rs("password"))&""" maxlength=""16""/></td></tr>"&_
			"<input type=""hidden"" name=""sid"" value="""&sid&"""/>"&_
			"<input type=""hidden"" name=""id"" value="""&id&"""/>"&_
			"<input type=""hidden"" name=""a"" value=""1""/>"&_
			"<tr><td colspan='2'><input type=""submit"" value=""保存修改""/></td></tr></table></form>"
	Else
		w "没有这个会员！<br/>"
	End If
	rs.close
	set rs=nothing
Else
	Dim name,pass,lenname,lenpass
	name=getData("name")
	pass=getData("pass")
	lenname=len(name)
	lenpass=len(pass)
	If name="" Or pass="" Then
		w "用户名密码不能为空!<br/><a href=""password.asp?sid="&sid&"&amp;id="&id&""">返回修改</a><br/>"
	Elseif IsNumeric(left(name,1)) Then
		w "用户名不能以数字开头!<br/><a href=""password.asp?sid="&sid&"&amp;id="&id&""">返回修改</a><br/>"
	Elseif lenname<3 or lenpass<3 or lenname>16 or lenpass>16 Then
		w "用户名密码长度为3-16位!<br/><a href=""password.asp?sid="&sid&"&amp;id="&id&""">返回修改</a><br/>"
	Else
		Dim Count
		Count=myconn.Execute("select count(id) from 74hu_user where name='"&name&"' and id<>"&id&"")(0)
		If Count<>0 Then
			w "用户名已存在!<br/><a href=""password.asp?sid="&sid&"&amp;id="&id&""">返回修改</a><br/>"
		Else
			myconn.execute("update 74hu_user set name='"&name&"',[password]='"&pass&"' where id="&id)
			w "修改成功!<br/><a href=""detail.asp?sid="&sid&"&amp;id="&id&""">返回管理</a><br/>"
		End If
	End If
End If
w "----------<br/><a href=""member.asp?sid="&sid&"&amp;"">[会员总管]</a>"

call bbsLast
%>